package bachelorMain;

import de.uni.main.R;
import de.uni.main.R.id;
import de.uni.main.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;


public class Place_Selection extends Activity {

	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
        setContentView(R.layout.place_selection);
	    
        final RadioButton rb0 = (RadioButton)findViewById(R.id.rb0);
        final RadioButton rb1 = (RadioButton)findViewById(R.id.rb1);
        final RadioButton rb2 = (RadioButton)findViewById(R.id.rb2);
        
        //start marker tracking
        Button ok_button = (Button) findViewById(R.id.ok_button);
        ok_button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	int area_id = 1;
            	if(rb0.isChecked())
            		area_id=1;
            	if(rb1.isChecked())
            		area_id=2;
            	if(rb2.isChecked())
            		area_id = -1;
            	Intent intent_manuell = new Intent(Place_Selection.this,ImageTargets.class);    
            	intent_manuell.putExtra("area_id", area_id);
            		startActivity(intent_manuell);        	
            }
        });
        
	}

	
	
	
    //generate menu
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.layout.menu, menu);
        return true;
    }

    //menu actions
    @Override
    public boolean onOptionsItemSelected(MenuItem item) { 
    	
    	if (item.getItemId() == R.id.back) 
    		finish(); //goes back to the previous activity
				
    	return true; 
    }
    
    
	
}
